﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GA.Shared.Interfaces;
using System.Windows;
using System.Runtime.Serialization;
using System.Windows.Data;

namespace GA.Shared.Objects
{
    public class ItemType : LinkedDependencyObject
    {
        /// <summary>
        /// Identifies the Id Property.
        /// </summary>
        public static readonly DependencyProperty IdProperty =
            RegisterProperty(
                "Id",
                typeof(int),
                typeof(ItemType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the Name Property.
        /// </summary>
        public static readonly DependencyProperty NameProperty =
            RegisterProperty(
                "Name",
                typeof(string),
                typeof(ItemType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the RarityId Property.
        /// </summary>
        public static readonly DependencyProperty RarityIdProperty =
            RegisterProperty(
                "RarityId",
                typeof(int),
                typeof(ItemType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the Rarity Property.
        /// </summary>
        public static readonly DependencyProperty RarityProperty =
            RegisterProperty(
                "Rarity",
                typeof(Rarity),
                typeof(ItemType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the IsEquippable Property.
        /// </summary>
        public static readonly DependencyProperty IsEquippableProperty =
            RegisterProperty(
                "IsEquippable",
                typeof(bool),
                typeof(ItemType),
                new PropertyMetadata(false));

        /// <summary>
        /// Identifies the SlotId Property.
        /// </summary>
        public static readonly DependencyProperty SlotIdProperty =
            RegisterProperty(
                "SlotId",
                typeof(int),
                typeof(ItemType),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the Slot Property.
        /// </summary>
        public static readonly DependencyProperty SlotProperty =
            RegisterProperty(
                "Slot",
                typeof(Slot),
                typeof(ItemType),
                new PropertyMetadata(null));

        /// <summary>
        /// Gets or sets the Id.
        /// </summary>
        
        public int Id
        {
            get { return (int)SafeGetValue(IdProperty); }
            set { SafeSetValue(IdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Name.
        /// </summary>
        
        public string Name
        {
            get { return (string)SafeGetValue(NameProperty); }
            set { SafeSetValue(NameProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Rarity Id.
        /// </summary>
        
        public int RarityId
        {
            get { return (int)SafeGetValue(RarityIdProperty); }
            set { SafeSetValue(RarityIdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Rarity.
        /// </summary>
        
        public Rarity Rarity
        {
            get { return (Rarity)SafeGetValue(RarityProperty); }
            set { SafeSetValue(RarityProperty, value); }
        }

        /// <summary>
        /// Gets or sets if this equippable.
        /// </summary>
        
        public bool IsEquippable
        {
            get { return (bool)SafeGetValue(IsEquippableProperty); }
            set { SafeSetValue(IsEquippableProperty, value); }
        }

        /// <summary>
        /// Gets or sets the slot id.
        /// </summary>
        
        public int SlotId
        {
            get { return (int)SafeGetValue(SlotIdProperty); }
            set { SafeSetValue(SlotIdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the slot this can be equipped in.
        /// </summary>
        
        public Slot Slot
        {
            get { return (Slot)SafeGetValue(SlotProperty); }
            set { SafeSetValue(SlotProperty, value); }
        }

        public ItemType()
        {
        }

        public ItemType(LinkedDependencyObject baseObject)
            : base(baseObject)
        {
        }

        public ItemType(LinkedDependencyObject baseObject, BindingMode bindingMode)
            : base(baseObject, bindingMode)
        {
        }
    }
}
